警告:这个程序不能按照我们想要的方式运行!它有一个逻辑错误,我们需要修复它!

如果键不在字典中,则my_dictionary .get( key )命令返回None

  • 点击运行控制台。看看my_value如何等于None
  • 通过将值为40的键"purple"添加到rainbow_dictionary来修复错误。
  • 完成后,单击提交接下来继续。

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)